// filename: MainDialog.cpp
// author: enic
// date: 2015-11-05

#pragma once

#include "MainDialog.h"

namespace DuiLib
{
	DUI_BEGIN_MESSAGE_MAP(MainDialog, XDuiWndBase)
		DUI_ON_MSGTYPE_CTRNAME(DUI_MSGTYPE_CLICK, _T("RecentlyListbtn"), OnBtnRecentlyList)
		DUI_ON_MSGTYPE_CTRNAME(DUI_MSGTYPE_CLICK, _T("friendbtn"), OnBtnFriend)
		DUI_ON_MSGTYPE_CTRNAME(DUI_MSGTYPE_CLICK, _T("groupbtn"), OnBtnGroup)
	DUI_END_MESSAGE_MAP()

	void MainDialog::OnBtnRecentlyList(TNotifyUI& notify)
	{
		m_pMainListLayout->SwitchView(EM_MainListLayout::emRecentSession);
	}

	void MainDialog::OnBtnFriend(TNotifyUI& notify)
	{
		m_pMainListLayout->SwitchView(EM_MainListLayout::emEAUserTree);
	}

	void MainDialog::OnBtnGroup(TNotifyUI& notify)
	{
		m_pMainListLayout->SwitchView(EM_MainListLayout::emGroupTree);
	}

	MainDialog::MainDialog()
	{
		m_pMainListLayout = NULL;
	}

	MainDialog::~MainDialog()
	{
	}

	LPCTSTR MainDialog::GetWindowClassName() const
	{
		return _T("TeamTalkMainDialog");
	}

	CDuiString MainDialog::GetSkinFile()
	{
		return _T("MainDialog.xml");
	}

	CDuiString MainDialog::GetSkinFolder()
	{
		return _T("");
	}

	void MainDialog::InitWindow()
	{
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_pMainListLayout, _T("MainListLayout"), MainListLayout);
	}

	void MainDialog::OnFinalMessage(HWND hWnd)
	{
		PostQuitMessage(0);
	}


}


